import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 近视防控-学生建档信息 */
export interface Student {
          id: number; // 编号
          name?: string; // 学生姓名
          sex: number; // 性别
          birthday: string | Dayjs; // 出生日期
          description: string; // 简介
          parMobile: string; // 家长手机号
  }

// 近视防控-学生建档 API
export const StudentApi = {
  // 查询近视防控-学生建档分页
  getStudentPage: async (params: any) => {
    return await request.get({ url: `/mcm/student/page`, params })
  },

  // 查询近视防控-学生建档详情
  getStudent: async (id: number) => {
    return await request.get({ url: `/mcm/student/get?id=` + id })
  },

  // 新增近视防控-学生建档
  createStudent: async (data: Student) => {
    return await request.post({ url: `/mcm/student/create`, data })
  },

  // 修改近视防控-学生建档
  updateStudent: async (data: Student) => {
    return await request.put({ url: `/mcm/student/update`, data })
  },

  // 删除近视防控-学生建档
  deleteStudent: async (id: number) => {
    return await request.delete({ url: `/mcm/student/delete?id=` + id })
  },

  /** 批量删除近视防控-学生建档 */
  deleteStudentList: async (ids: number[]) => {
    return await request.delete({ url: `/mcm/student/delete-list?ids=${ids.join(',')}` })
  },

  // 导出近视防控-学生建档 Excel
  exportStudent: async (params) => {
    return await request.download({ url: `/mcm/student/export-excel`, params })
  },
}